package com.pureut.production.controller;


import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.production.service.KanBanService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 看板控制层
 * @author: CM
 * @date: 2023/5/4  15:19
 */
@RestController
@RequestMapping("/kanban")
public class KanBanController extends BaseController {

    //看板Service
    @Resource
    private KanBanService kanBanService;

    /**
     * 水刺看板-车间信息
     */
    @GetMapping("/getWorkshopInfo")
    public AjaxResult getWorkshopInfo(String lineCode) {
        return AjaxResult.success(kanBanService.getWorkshopInfo(lineCode));
    }

    /**
     * 水刺看板-线边库存情况
     */
    @GetMapping("/getLineStockInfo")
    public AjaxResult getLineStockInfo(String lineCode) {
        return AjaxResult.success(kanBanService.getLineStockInfo(lineCode));
    }

    /**
     * 水刺看板-水刺制令单（生产中）
     */
    @GetMapping("/getManufacturingOrder")
    public AjaxResult getManufacturingOrder(String lineCode) {
        return AjaxResult.success(kanBanService.getManufacturingOrder(lineCode));
    }

    /**
     * 水刺看板-水刺制令单（待上线）
     */
    @GetMapping("/getToBeOnline")
    public AjaxResult getToBeOnline(String lineCode) {
        return AjaxResult.success(kanBanService.getToBeOnline(lineCode));
    }

    /**
     * 水刺看板-班组月产量统计
     */
    @GetMapping("/getTeamsMonthOutput")
    public AjaxResult getTeamsMonthOutput(String lineCode) {
        return AjaxResult.success(kanBanService.getTeamsMonthOutput(lineCode));
    }

    /**
     * 生产看板-产线产量统计对比
     */
    @GetMapping("/getProductionContrast")
    public AjaxResult getProductionContrast(String lineCode) {
        return AjaxResult.success(kanBanService.getProductionContrast(lineCode));
    }

    /**
     * 生产看板-设备运行情况
     */
    @GetMapping("/getEquipmentOperation")
    public AjaxResult getEquipmentOperation(String lineCode) {
        return AjaxResult.success(kanBanService.getEquipmentOperation(lineCode));
    }

    /**
     * 生产看板-班组近7天良品率
     */
    @GetMapping("/getTeamGoodProducts")
    public AjaxResult getTeamGoodProducts(String lineCode) {
        return AjaxResult.success(kanBanService.getTeamGoodProducts(lineCode));
    }

    /**
     * 生产看板-本月品质不良分布
     */
    @GetMapping("/getMonthBad")
    public AjaxResult getMonthBad(String lineCode) {
        return AjaxResult.success(kanBanService.getMonthBad(lineCode));
    }

}
